﻿using Feicui.BeautyCRM.Common;
using Feicui.BeautyCRM.UIPortal.Models.ViewModel;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Feicui.BeautyCRM.UIPortal.Controllers
{
    public class BaseController : Controller
    {
        //
        // GET: /Base/

        public ActionResult Index()
        {
            return View();
        }

        /// <summary>
        /// 登录头部信息
        /// </summary>
        /// <returns></returns>
        public PartialViewResult HeaderForLogIn()
        {
            UserViewModel userModel = JsonConvert.DeserializeObject<UserViewModel>(AspFormsAuthentication.getUserInfo());
            return PartialView("_HeaderForLogIn", userModel);
        }

        /// <summary>
        /// 是否已登录
        /// </summary>
        /// <returns></returns>
        protected bool IsLogin
        {
            get
            {
                return HttpContext.User.Identity.IsAuthenticated;
            }
        }

    }
}
